net/packet: fix overflow in check for tp_reserve
authorAndrey Konovalov <andreyknvl@google.com>
Wed, 29 Mar 2017 14:11:22 +0000 (16:11 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 30 Mar 2017 01:16:33 +0000 (01:16 +0000)
commit6276684044cf9951217a9849960f4cf8684d237f
tree7027c16f3b44eefb86254634e8b53be5e89e7257
parent2cc634d0a6f09f899ea301ab074850dbe1dda300
net/packet: fix overflow in check for tp_reserve

When calculating po->tp_hdrlen + po->tp_reserve the result can overflow.

Fix by checking that tp_reserve <= INT_MAX on assign.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name net-packet-fix-overflow-in-check-for-tp_reserve.patch
net/packet/af_packet.c